<?php
$taskId = $_GET['id'];
if(empty($taskId)) {
    echo "参数错误";
    exit();
}

$dsn = "sqlsrv:Server=localhost;Database=Task";
$db = new PDO($dsn, "sa", "123456");

$sql = "delete from Task where TaskId='" . $taskId . "' ";
$result = $db->exec($sql);
if ($result) {
    echo "删除成功<br />";
    echo "<a href='task_list.php'>返回列表页面</a>";
}